#!/bin/bash
if [ -n "$2" ]
then
	do_date=$2
else
	#echo 必须给我传一个日期
	#exit
	do_date= $(date -d yesterday +%F) 
fi

echo 当前要操作的日期是$do_date

dws_trade_user_order_td="

"

dws_user_user_login_td="

"

case $1 in
"dws_trade_user_order_td")
	hive --database gmall -e "$dws_trade_user_order_td"
	;;
"dws_user_user_login_td")
	hive --database gmall -e "$dws_user_user_login_td"
	;;
"all")
	hive --database gmall -e "$dws_trade_user_order_td$dws_user_user_login_td"
	;;
esac

